﻿using System;
using System.Windows;
using Bulb.Core.ViewModels;
using Cirrious.MvvmCross.WindowsPhone.Views;

namespace Bulb.UI.WindowsPhone.Views
{
    public partial class DetailBulbView : MvxPhonePage
    {
        public DetailBulbView()
        {
            InitializeComponent();
        }

        private void ApplicationBarIconButtonDelete_OnClick(object sender, EventArgs e)
        {
            if(MessageBox.Show("Are you sure?", "Delete item", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                ((DetailBulbViewModel)ViewModel).DeleteCommand.Execute(null);
        }

        private void ApplicationBarIconButtonEdit_OnClick(object sender, EventArgs e)
        {
            ((DetailBulbViewModel)ViewModel).EditDetailCommand.Execute(null);
        }
    }
}